unit uHuaci;

interface

uses
  SysUtils, Classes, Windows;

type
  TGetWideStrProc = procedure(const WS: pWideChar) of object;

  THuaciObj = class(TObject)
  private
    FOnGetHuaciText: TGetWideStrProc;
    FOnGetQuciText: TGetWideStrProc;
  public
    procedure Huaci(b: Boolean);
    procedure Quci(b: Boolean);

    constructor Create;
    destructor Destroy; override;

    property OnGetHuaciText: TGetWideStrProc read FOnGetHuaciText write FOnGetHuaciText;
    property OnGetQuciText: TGetWideStrProc read FOnGetQuciText write FOnGetQuciText;
  end;

implementation

  procedure StartQuci(b: Boolean; const AOnGetQuciText: TGetWideStrProc = nil;
    const Adelag: Integer = 300;
    const h: hWnd = 0; const debug: Boolean = False); stdcall; external 'HuaciPrj.dll';

  procedure StartHuaci(b: Boolean; const AOnGetHuaciText: TGetWideStrProc = nil;
    const ADelay: Integer = 300;
    const h: hWnd = 0; const debug: Boolean = False); stdcall; external 'HuaciPrj.dll';

{ THuaciObj }

constructor THuaciObj.Create;
begin
  //
end;

destructor THuaciObj.Destroy;
begin
  Huaci(False);
  Quci(False);
  inherited;
end;

procedure THuaciObj.Huaci(b: Boolean);
begin
  StartHuaci(b, FOnGetHuaciText);
end;

procedure THuaciObj.Quci(b: Boolean);
begin
  StartQuci(b, FOnGetQuciText);
end;

end.
